<div class="wrap">
<table width="100%" height="100%" cellpadding="0" cellspacing="0">
	<tr>
	<td width="54px" height="43px" class="fr_lefttop"></td>
	<td height="43px" class="fr_centertop" ></td>
	<td width="48px" height="43px" class="fr_righttop"></td>
	</tr>
	<tr>
	<td width="54px" class="fr_leftmiddle" >&nbsp;</td>
	<td class="fr_centermiddle">
{if $smarty.cookies.message == null}
	<div id="ajaxResponse1" class="ajaxResponse"></div>
{else}
	<div id="ajaxResponse1" class="ajaxResponse fade" style="display:block">{if $smarty.cookies.message != NULL}{$smarty.cookies.message}{/if}</div>
{/if}
<h2>{t}Categories{/t}</h2>
	<p>
		<a href="?mod={$smarty.get.mod}&sub1=category&act=newcategory">
				<b>{t escape=no}Create New Category &raquo;{/t}</b></a>
	</p>
	<table class="widefat">
		<thead>
		<tr>
			<th scope="col" style="text-align: center">{t}ID{/t}</th>
	        <th scope="col">{t}Name{/t}</th>
            <th scope="col">{t}Main menu{/t}</th>
            <th scope="col">{t}Parent{/t}</th>
	        <th scope="col" style="text-align:center">{t}Active{/t}</th>
	        <th colspan="3" style="text-align: center">{t}Action{/t}</th>
		</tr>
		</thead>
		<tbody id="cattable">
			{foreach name=cat from=$ALLCATS.data item=item}
				<tr id="cat-{$item->cat_ID}" class="{cycle values=,alternate}">
					<th scope='row' style='text-align: center'>{$item->cat_ID}</th>
					<td>{$item->cat_name}</td>
                    <td>{$item->cat_type_name}</td>
                    <td>{$item->parent_name}</td>
					<td valign="middle" align="center">{if $item->active eq '1'}x{/if}</td>
                    <td align='center'>
                    		<a href="?{$smarty.server.QUERY_STRING}&amp;act=position&id={$item->cat_ID}"><img src="includes/images/change_position.png" alt="Change" title="Change Position" /></a>
                    </td>
					<td><a href="?mod={$smarty.get.mod}&sub1=editcategory&id={$item->cat_ID}" class='edit'>{t}Edit{/t}</a></td>
					<td><a onclick="onDeleteCat('?mod={$smarty.get.mod}&sub1={$smarty.get.sub1}','{$item->cat_ID}', 'cat','{$item->cat_parent}','{$item->cat_position}')" 
								class='delete'>{t}Delete{/t}</a></td>
				</tr>
			{/foreach}
		</tbody>
	</table>
    {if $ALLCATS.TOTALPAGE > '0' }
    <div>			
             		
              <div style="text-align:right; float:right" >{$ALLCATS.FIRST} {$ALLCATS.PRE}&nbsp;{$ALLCATS.LISTPAGE}  {if $smarty.session.LC_ALL eq "en"}Pages{else}Trang{/if} &nbsp; {$ALLCATS.TOTALPAGE} &nbsp;                   
                  &nbsp;{$ALLCATS.NEXT} {$ALLCATS.LAST}         
              </div>
              <div style="clear:both"></div>		
    </div>	     
    {/if}
    <p>
		<a href="?mod={$smarty.get.mod}&sub1=category&act=newcategory">
				<b>{t escape=no}Create New Category &raquo;{/t}</b></a>
	</p>
</td>
<td width="48px" class="fr_rightmiddle"></td>
</tr>
<tr>
<td width="54px" height="60px" class="fr_leftbot" ></td>
<td height="60px" class="fr_centerbot"></td>
<td width="48px" height="60px" class="fr_rightbot" ></td>
</tr>
</table>
</div>

